from sklearn.metrics import log_loss

print (log_loss(["spam", "ham", "ham", "spam"],[[.1, .9], [.9, .1], [.8, .2], [.35, .65]]))

print (log_loss(["spam", "ham"],[[1, 0], [1, 0]]))